package com.xiaocg.singleton;

import java.lang.reflect.Constructor;

public class SingleTonTest {
    public static void main(String[] args) throws Exception{


        Class<Singleton> singletonClass = Singleton.class;
        Constructor<Singleton> declaredConstructor = singletonClass.getDeclaredConstructor();
        declaredConstructor.setAccessible(true);
        Singleton singleton = declaredConstructor.newInstance();
        Singleton singleton1 = declaredConstructor.newInstance();

        System.out.println(singleton==singleton1);

        Runtime runtime = Runtime.getRuntime();
        Process exec = runtime.exec("ipconfig");
        byte[] bytes = new byte[1024*1024*1000];
        int len = exec.getInputStream().read(bytes);
        String s = new String(bytes,0,len,"GBK");
        System.out.println(s);
    }
}
